package com.example.demo.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.demo.entity.Comment;
import com.example.demo.entity.ReciteNum;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface CommentMapper extends BaseMapper<Comment> {

    @Select("SELECT user_id,username,COUNT(content) as reciteNum FROM comments GROUP BY user_id,username")
    List<ReciteNum> selectCommentRank();

}
